package org.ejc.struts.address;


import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;

/**
 * Form for address.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="addressForm"
 */
public class AddressForm extends ValidatorForm implements Serializable {

   /**
	 * 
	 */
	private static final long serialVersionUID = 1L;


   private java.lang.Object _addressId = null;
   private java.lang.Integer _countryCodeCountryId = null;
   private java.lang.String _addressLine1 = null;
   private java.lang.String _addressLine2 = null;
   private java.lang.String _cityTown = null;

   
   /**
    * Reset all properties to their default values.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public void reset(ActionMapping mapping, HttpServletRequest request) {
	   _addressId = null;
	   _countryCodeCountryId = null;
      _addressLine1=null;
      _addressLine2=null;
      _cityTown=null;
      
      
   }
   
   /**
    * Standard constructor.
    */
   public AddressForm() {
   }

   /**
    * Returns the addressId
    *
    * @return the addressId
    */
   public java.lang.Object getAddressId() {
      return _addressId;
   }

   /**
    * Sets the addressId
    *
    * @param addressId the new addressId value
    */
   public void setAddressId(java.lang.Object addressId) {
      _addressId = addressId;
   }
   /**
    * Returns the countryCodeCountryId
    *
    * @return the countryCodeCountryId
    */
   public java.lang.Integer getCountryCodeCountryId() {
      return _countryCodeCountryId;
   }

   /**
    * Sets the countryCodeCountryId
    *
    * @param countryCodeCountryId the new countryCodeCountryId value
    */
   public void setCountryCodeCountryId(Integer countryCodeCountryId) {
      _countryCodeCountryId = countryCodeCountryId;
   }
   /**
    * Returns the addressLine1
    *
    * @return the addressLine1
    */
   public java.lang.String getAddressLine1() {
      return _addressLine1;
   }

   public void setAddressLine1(java.lang.String addressLine1) {
      _addressLine1 = addressLine1;
   }
   /**
    * Returns the addressLine2
    *
    * @return the addressLine2
    */
   public java.lang.String getAddressLine2() {
      return _addressLine2;
   }

   /**
    * Sets the addressLine2
    *
    * @param addressLine2 the new addressLine2 value
    */
   public void setAddressLine2(java.lang.String addressLine2) {
      _addressLine2 = addressLine2;
   }
   /**
    * Returns the cityTown
    *
    * @return the cityTown
    */
   public java.lang.String getCityTown() {
      return _cityTown;
   }

   /**
    * Sets the cityTown
    *
    * @param cityTown the new cityTown value
    */
   public void setCityTown(java.lang.String cityTown) {
      _cityTown = cityTown;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
//   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
//      ActionErrors errors = new ActionErrors();
//      // test for nullity
//      if(getAddressId() == null) {
//         errors.add("addressId", new ActionError("error.addressId.required"));
//      }
//      if(getCountryCodeCountryId() == null) {
//         errors.add("countryCodeCountryId", new ActionError("error.countryCodeCountryId.required"));
//      }
//      // TODO test format/data
//      return errors;
//   }
}
